GtkDialog: avoid underallocations
authorMatthias Clasen <mclasen@redhat.com>
Fri, 10 Jun 2011 00:40:45 +0000 (20:40 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 10 Jun 2011 00:43:02 +0000 (20:43 -0400)
GtkDialog changes its size depending on style properties. If
we only do this in response to ::style-updated, it happens during
the initial realization of the dialog and leads to the dialog
'growing' between when we determine the initial window size and
when we allocate it that size. So, do this beforehand.

gtk/gtkdialog.c

index 6aae900303f9ec4ac9cea79e10e4cb9e5441a44d..931ac617fe592295e57d0b94896c029e02632f05 100644 (file)
@@ -349,6 +349,7 @@ update_spacings (GtkDialog *dialog)
                         "action-area-border", &action_area_border,
                         NULL);
 
+  
   gtk_container_set_border_width (GTK_CONTAINER (priv->vbox),
                                   content_area_border);
   if (!_gtk_box_get_spacing_set (GTK_BOX (priv->vbox)))
@@ -397,6 +398,8 @@ gtk_dialog_init (GtkDialog *dialog)
   gtk_window_set_type_hint (GTK_WINDOW (dialog),
                            GDK_WINDOW_TYPE_HINT_DIALOG);
   gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ON_PARENT);
+
+  update_spacings (dialog);
 }
 
 static GtkBuildableIface *parent_buildable_iface;